<!doctype html>
<html class="no-js"
	 xmlns:th="http://www.thymeleaf.org">
<head th:replace="/admin/layout :: head">
</head>
<body>
<!--[if lte IE 9]>
<p class="browsehappy">你正在使用<strong>过时</strong>的浏览器，暂不支持。 请 <a href="http://browsehappy.com/" target="_blank">升级浏览器</a>
  以获得更好的体验！</p>
<![endif]-->

<th:block th:replace="/admin/layout :: nav_main"></th:block>


<div class="am-cf admin-main">
  <!-- sidebar start -->
  <th:block th:replace="/admin/layout :: sidebar('home')"></th:block>
  <!-- sidebar end -->

  <!-- content start -->
  <div class="admin-content">

    <div class="am-cf am-padding">
      <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">积极分子管理</strong> / <small>添加</small></div>
    </div>

    <div class="am-g">
      <div class="am-u-sm-12">
		   <form th:action="@{/admin/userPositive/create}" method="post" class="am-form" autocomplete="off">
			   <div class="am-form-group">
			      <label>机构名称</label>
			      <input type="text" name="deptName" autocomplete="off" value=""/>
			    </div>
			    <div class="am-form-group">
			      <label>姓名</label>
			      <input type="text" name="nickname" autocomplete="off" value=""/>
			    </div>

			    <div class="am-form-group">
			      <label>性别</label>
			      <select name="sex">
			      	<option value="1">女</option>
			      	<option value="2">男</option>
			      </select>
			    </div>

			   <div class="am-form-group">
				   <label>出生日期</label>
				   <input type="text" name="birthday" class="am-form-field" placeholder="出生日期" data-am-datepicker="" readonly="" required=""  />
			   </div>

			   <div class="am-form-group">
				   <label>民族</label>
				   <input type="text" name="minority" placeholder="民族" autocomplete="off" value=""/>
			   </div>

			   <div class="am-form-group">
				   <label>籍贯</label>
				   <input type="text" name="origin" placeholder="籍贯" autocomplete="off" value=""/>
			   </div>

			   <div class="am-form-group">
				   <label>职业</label>
				   <input type="text" name="occupation" placeholder="职业" autocomplete="off" value=""/>
			   </div>

			   <div class="am-form-group">
				   <label>文化程度</label>
				   <input type="text" name="education" placeholder="文化程度" autocomplete="off" value=""/>
			   </div>

			   <div class="am-form-group">
				   <label>发展人</label>
				   <input type="text" name="develUser" placeholder="发展人" autocomplete="off" value=""/>
			   </div>

			   <div class="am-form-group">
				   <label>发展日期</label>
				   <input type="text" name="develTime" class="am-form-field" placeholder="发展日期" data-am-datepicker="" readonly="" required=""  />
			   </div>


			   <div class="am-form-group am-form-file">
				   <label>头像</label>
				   <div id="filePicker0">
					   <button type="button" class="am-btn am-btn-default am-btn-sm"><i
							   class="am-icon-cloud-upload"></i> 点击上传
					   </button>
				   </div>
			   </div>
			   <div class="am-form-group am-form-file">
				   <input type="hidden" name="avatar" id="img_url_0"/>
				   <div class="am-u-md-4">
					   <img id="img_url0" class="am-img-thumbnail am-img-bdrs"
							src="" alt=""/>
				   </div>
			   </div>

			   <div class="am-form-group">
				   <label>备注</label>
				   <input type="text" name="notes" placeholder="备注" autocomplete="off" value=""/>
			   </div>

			    <div th:text="${message}" style="color: red;"></div>
		   		<button type="submit" class="am-btn am-btn-secondary am-margin-top am-margin-bottom">提交</button>
			   <button type="button" onclick="history.back()"
					   class="am-btn am-margin-top am-margin-bottom">返回
			   </button>
		   </form>

      </div>
    </div>

  </div>
  <!-- content end -->

</div>

<a href="#" class="am-show-sm-only admin-menu" data-am-offcanvas="{target: '#admin-offcanvas'}">
  <span class="am-icon-btn am-icon-th-list"></span>
</a>


<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="assets/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->

<!--[if (gte IE 9)|!(IE)]><!-->
<script src="/javascript/jquery.min.js"></script>
<!--<![endif]-->
<script src="/javascript/amazeui.min.js"></script>
<script type="text/javascript" src="/javascript/amazeui.datetimepicker.min.js"></script>
<script src="/javascript/app.js"></script>



<link rel="stylesheet" type="text/css" href="/plugin/webuploader-0.1.5/webuploader.css"/>
<script type="text/javascript" src="/plugin/webuploader-0.1.5/webuploader.js"></script>


<script>

	var uploader0 = WebUploader.create({
		// 选完文件后，是否自动上传。
		auto: true,

		// swf文件路径
		swf: '/js/Uploader.swf',

		// 文件接收服务端。
		server: '/image/upload',
		fileVal: 'uploadImgFile',

		// 选择文件的按钮。可选。
		// 内部根据当前运行是创建，可能是input元素，也可能是flash.
		pick: '#filePicker0',

		// 只允许选择图片文件。
		accept: {
			title: 'Images',
			extensions: 'gif,jpg,jpeg,bmp,png',
			mimeTypes: 'image/jpg,image/jpeg,image/png'
		}
	});

	// 文件上传成功，给item添加成功class, 用样式标记上传成功。
	uploader0.on('uploadSuccess', function (file, response) {
		var src = response.image;
		$('#img_url0').attr('src', src);
		$('#img_url_0').val(src);
	});

</script>

</body>
</html>
